import request from '@/utils/Request.js';

// 资产分页查询
export function AssetList(params) {
    return request.get('/admin/asset/list', params)
}

// 获取单个资产详情
export function getAssetDetail(id) {
    return request.get(`/admin/asset/detail/${id}`)
}

//新增资产
export function addAsset(params) {
    return request.post(`/admin/asset/add`, params);
}

//删除资产
export function deleteAsset(id) {
    return request.delete(`/admin/asset`,id)
}

//更新资产
export function updateAsset(id, params) {
    return request.put(`/admin/asset/update/${id}`, params);
}

// 导入资产
export function importAsset(data) {
    return request.post('/admin/asset/import', data, {
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    });
}

// 导出资产
export function exportAsset(params) {
    return request.downloadFile('/admin/asset/export', params, '资产列表.xlsx');
}